{{foreach from=$shopname item=li key=key}}
    <br> <h4> <input type="checkbox" name="shopID[]" id="pre{{$li.0.platfromname}}" value="{{$li.0.platfromname}}" onClick="checkson('{{$li.0.platfromname}}');"  /> 【{{$key}}平台】</h4>
    <hr>
    {{if $key=='Amazon' or $key=='ebay'}}
    	<div style="padding:2px 30px;">
        
        {{foreach from=$shopgroup item=groupname key=index}}
        	{{if ($index<20 and $key=='Amazon') or ($index>=20 and $key=='ebay')}}
            <h4> <input type="checkbox" name="shopID[]" id="country{{$index}}" value="{{$index}}" onClick="checkCountry('{{$index}}');"  /> 【{{$shopgroup[$index]}}】</h4>
            <hr>
            {{foreach from=$country_shops[$index] name=infolist item=res key=li}}
                <div style="width:190px; float:left;overflow:hidden; text-overflow:ellipsis; white-space:nowrap;">
                <input name="shopname[]" type="checkbox" class="shop_checkbox counstry{{$index}}" id="son{{$res.platfromname}}" value="{{$res.name}}" 
                {{if $res.name|in_array:$selected_array}}checked="checked"{{/if}} data-text="{{$res.id}}"  />
                {{$res.name}} </div>
                {{if $smarty.foreach.infolist.iteration % 7==0}}
                <br> 
                {{/if}}
                &nbsp;&nbsp;
            {{/foreach}} <br>
            <div style="clear:both"></div><br />
			{{/if}}
        {{/foreach}} 
        </div>
    {{else}}
    	<div style="padding:2px 15px;">
        {{foreach from=$li name=infolist item=res key=key}}
            <div style="width:200px; float:left;overflow:hidden; text-overflow:ellipsis; white-space:nowrap;">
            <input name="shopname[]" type="checkbox" class="shop_checkbox" id="son{{$res.platfromname}}" value="{{$res.name}}" 
            {{if $res.name|in_array:$selected_array}}checked="checked"{{/if}} data-text="{{$res.id}}"  />
            {{$res.name}} </div>
            {{if $smarty.foreach.infolist.iteration % 7==0}}
            <br> 
            {{/if}}
            &nbsp;&nbsp;
        {{/foreach}} <br>
        <br>  
        <div style="clear:both"></div>
        </div>
    {{/if}}
{{/foreach}} 
<script language="javascript">
	function checkCountry(sonid){
	  //如果有子菜单，则子菜单的所有check状态和父亲一样
	  var inputs = document.getElementsByName("shopname[]");
	  for(var i=0;i<inputs.length;i++){
		 if(inputs[i].className == "shop_checkbox counstry"+sonid){
			if(document.getElementById("country"+sonid).checked == true){
			   inputs[i].checked = true;
			}else{
			   inputs[i].checked = false;;
			}
		 }
	  }
	}
</script>
<style type="text/css">
body {
	margin:0px !important;
	position: relative;
}
</style>